/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * <p>Project: javaseapp - List1
 * <p>Powered by webrx On 2021-08-09 14:47:51
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 16
 */
public class List2 {
    public static void main(String[] args) {
        //Array
        Integer[] n1 = new Integer[]{1, 2, 3};

        //固定尺寸的List
        List list0 = Arrays.asList(n1);
        System.out.println(list0.size());
        System.out.println(list0);

        //固定尺寸的List
        List list = List.of(0, 0, 0);
        //list.add(30); 错误
        System.out.println(list);

        //List4 泛型
        List<String> list2 = new ArrayList<>();
        var list3 = new ArrayList<String>();
        System.out.println(list2);
        System.out.println(list3);
        String[] a1 = (String[]) list2.toArray();

    }
}
